import sys,time
import os
import pandas as pd
from Predict_6625Job import Predict_6625Job

def main(mode,st_no,aim_st_s):
    try:
        mode = int(mode)
        st_no = str(st_no)
        aim_st_s = float(aim_st_s)
        success_tmp = True
        msg = ''
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    except Exception as e:
        success_tmp = False
        msg = f'invalid_parameter_type--{str(e)}'
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    if success_tmp:
        msg, y_pred_output = Predict_6625Job(p_mode=mode,p_st_no=st_no, p_aim_st_s=aim_st_s).execute()
        timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
        success_tmp = True
    success = success_tmp
    message = msg
    timestamp = timestamp
    y_pred_output = y_pred_output
    return success, message, timestamp, y_pred_output
if __name__ == '__main__':
    # 出钢记号，目标S，必选，确定钢种
    mode = 1
    st_no = 'IH2554A2'
    aim_st_s = 20
    success, message, timestamp, y_pred_output = main(mode,st_no,aim_st_s)
    print(success, message, timestamp, y_pred_output)
